<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="../../css/aui.css">
    <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
    <link rel="stylesheet" type="text/css" href="../../css/api.css">
    <link rel="stylesheet" type="text/css" href="../../font-icon/demo.css">
    <link rel="stylesheet" type="text/css" href="../../font-icon/iconfont.css">
    <script type="text/javascript" src="../../script/api.js"></script>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
    
</head>
<style>
.fasong{
width: 3.2rem;
height: 1.6rem;
background-color: #f84d1f;
color:#fff;
border:none;
font-size: 0.8rem;
}
.close_word{
    color: #fff;
    float: left;
    font-size: 0.9rem;
    margin-left: 0.5rem
}
.get_coment{
    width: 94%;
    height:4rem;
    margin-left: 3%;
    background-color: #fff;
   
}
.get_coment textarea{
    width: 100%;
    height: 100%;
    font-size: 0.8rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}
body{
    background-color: #fff;
}
.zhuanfa_text{
    width: 100%;
    height:4.5rem;
    margin-top: 2rem;
    position:relative;
    background-color: #eeeeee;
}
.zhuanfa_text_div{
    width: 4.5rem;
    height: 4.5rem;
    background-color: black;
    position: absolute;
    
}
.zhuanfa_name{
    margin-left: 5rem;
    font-size: 0.8rem;
    font-weight: 650;
}
.som{
    display: flex;
    flex-direction: column;
   
}
.zhuanfa_text_neir{
    margin-left:5rem;
    flex-direction:row;
    width: 12rem;;
    height: 3rem;
    display: flex;
   
}
.zhuanfa_text_neir_1{
    width:12rem;
color:#6c6c6c;
word-break: break-all;

text-overflow: ellipsis;

display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/

-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/

-webkit-line-clamp: 3; /** 显示的行数 **/

overflow: hidden;  /** 隐藏超出的内容 **/
font-size: 0.75rem;
line-height: 1rem;
}
.gongneng{
    width: 100%;
    height:6rem; 
    background-color: #fff;  
    margin-top: 6rem;
    display: flex;
    flex-direction: column;
    border-top: solid 0.05rem #eeeeee;
}
.one_weizhi_youquan{
    width: 90%;
    height: 50%;
    margin-left: 5%;
    background-color: #fff;
    border-bottom: solid 0.05rem #eeeeee;
    line-height: 3rem;
    color:#6c6c6c;
}
</style>
<body>
        <header id="header" class="aui-bar aui-bar-nav" style="background-color:  #ff9f00;height: 3rem" >
                <div class="close_word" onclick="api.closeWin()">取消</div>
                <div class="aui-title">转发动态</div>
                
                <div  style="float: right;margin-right: 0.5rem;" ><button class="fasong" onclick="send_zhuanfa()">发送</button></div>
              
        </header>

        <div class="get_coment"><textarea type="text"maxlength="50" placeholder="最多输入50个字..."></textarea><div>
        
        <div class="zhuanfa_text" id="zhuanfa_text">
                
        </div>

        <div class="gongneng">
            <!-- <div class="one_weizhi_youquan">
                <span class="aui-iconfont aui-icon-location" style="font-size: 1rem;"></span>
                <span style="font-size: 0.8rem;margin-left: 0.3rem;">所在位置</span>
                
                <span class="aui-iconfont aui-icon-right" style="font-size: 0.9rem;float: right;"></span>
                <span style="float: right;margin-right: 0rem;font-size: 0.8rem;">武侯xxxx</span>
            </div> -->
            <div class="one_weizhi_youquan">
                <span class="aui-iconfont aui-icon-my" style="font-size: 1rem;"></span>
                <span style="font-size: 0.8rem;margin-left: 0.3rem;">谁可以看</span>
                
                <span class="aui-iconfont aui-icon-right" style="font-size: 0.9rem;float: right;"></span>
                <!-- <span style="float: right;margin-right: 0rem;font-size: 0.8rem;">公开</span> -->
               <div style="float: right;margin-right: 0rem;font-size: 0.8rem;margin-top: 0.5rem;">
                <select id="test" >
                    <option selected="selected" value ="1">公开</option>
                    <option value ="0">仅自己可见</option>
                </select>
               </div>
                
            </div>
        </div>
</body>
<script>
apiready = function() {
    get_zhuanfa_content();
    function get_zhuanfa_content() {
                    var token = $api.getStorage('token');
                    var id = $api.getStorage('zhuanfa_id');
                    
                    var token = {
                        token: token,
                        dtid:id,
                        categry:'get_dt'

                        };
                    api.ajax({
                        url: 'http://www.mk517.com/webApi/youquans.php',
                        method: 'post',
                        "headers": {
                            "Content-Type": "application/json"
                        },
                        dataType: "json",
                        data: {
                            body: token
                        }
                    }, function(ret, err) {
                    
                        // alert(JSON.stringify(ret));
                        if (ret) {
                          
                            $api.byId('zhuanfa_text').innerHTML='<div class="zhuanfa_text_div"><img src="'+ret['img'][0]+'"></div>'+
                                                                '<div class="som" >'+
                                                                '<div class="zhuanfa_name">@'+ret['name']+'</div>'+
                                                                '<div class="zhuanfa_text_neir"><div class="zhuanfa_text_neir_1" type="text"  readonly="readonly" >'+ret['content']+'</div></div>'+
                                                                '</div>';
                     
                
                }else {
                alert(JSON.stringify(err));
             }
             });


            }




       //提交转发
       window.send_zhuanfa = function(){
           
        var open =$('#test').val();
        
        var else_content = $('textarea').eq(0).val();
        
        var id = $api.getStorage('zhuanfa_id');
       
                var id = $api.getStorage('zhuanfa_id');
                 var token = $api.getStorage('token');
                  
                var token = {
                            token: token,
                            do:'forward',
                            to:id,
                            content:else_content,
                            open:open

                        };
                    api.ajax({
                        url: 'http://www.mk517.com/webApi/youquan_do.php',
                        method: 'post',
                        "headers": {
                            "Content-Type": "application/json"
                        },
                        dataType: "json",
                        data: {
                            body: token
                        }
                    }, function(ret, err) {
                        // alert(JSON.stringify(ret));
                        if (ret) {
                            // alert(ret.sta);
                           if(ret.sta==1){
                            alert('发送成功!');
                            api.sendEvent({
                               name:'zhuanfa',
                               extra:{
                                   key_zhaunfa:'value_zhuanfa'
                               }
                           });
                           api.closeWin();
                           }else if(ret.sta==0){
                            alert('发送失败!');
                           }
                       
                        }else {
                            alert(JSON.stringify(err));
                        }
                    });

                
       }
       


}
</script>
</html>